import 'package:flutter/cupertino.dart';

void main() {
  List list = [1, 2, 3];
  var a = printE;
  list.forEach(a);
}

void printE(int e) {
  print(e);
}

//  {int c}  可选，作为命名参数
int add2(int a, int b, {int c, int d, int e}) {
  return a + b;
}

int add3({@required int a, int b}) {
  return a + b;
}

int add(int a, int b) {
  return a + b;
}

void printInfo(String name, String address,
    {String phone = '9999', String sex = "男"}) {
  print('姓名：$name 地址：$address 电话号码：${phone ?? '0000'} 性别：$sex');
}

int getResult(int a, [int b = 1, int c = 0]) {
  return a + b + c;
}

int getResult2(int a, [int b, int c]) {
  return a + b ?? 0 + c ?? 0;
}
